#ifndef TABLECOLUMN_H
#define TABLECOLUMN_H

#include "column.h"
#include "enums.h"

#include <string>

using namespace std;

/*
    Class: TableColumn
    Inherits from Column.
    Represents a column of a SQL table.

    See also:
        Column.
*/
class TableColumn : public Column
{
    /* Section: public */
    public:
        /*
            Destructor: Default destructor.
            Destroy the object.
        */
        virtual ~TableColumn();

        /*
            Constructor: Copy constructor.
            Initializes the object as a copy from other TableColumn.

            Parameters:
                other - TableColumn to copy from.
        */
        TableColumn(const TableColumn& other);

        /*
            Constructor: Parametrized constructor.
            Initializes the object with the given parameters.

            Parameters:
                name - Name of the column.
                type - Type of the column.

            See also:
                TableColumnType
        */
        TableColumn(TableColumnType type, const string & name = "");

        /*
            Method: GetType
            Returns:
                The type of the TableColumn.

            See also:
                TableColumnType
        */
        TableColumnType getType();

        /*
            Method: SetType
            Sets the type of the TableColumn.

            Parameters:
                type - TablecolumnType to set.

            See also:
                TableColumnType
        */
        void setType(TableColumnType type);

        /*
            Method: ToString
            Returns:
                A string representation of the TableColumn.
        */
        virtual string toString();

        /*
            Method: clone
            Returns:
                A clone of this object.
        */
        virtual TableColumn * clone();

    /* Section private */
    private:
        /*
            Variable: type
            Type: TableColumnType
            Defines the type of the TableColumn.

            See also:
                TableColumnType
        */
        TableColumnType type;
};

#endif // TABLECOLUMN_H
